﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

namespace Pharmacy.Data
{
    public interface IRepository<T> where T : class
    {
        /// <summary>
        /// Gets the lazily initialized value of the current <see cref="IQueryable{T}"/> instance.
        /// </summary>
        IQueryable<T> AsQueryable();

        T First(Expression<Func<T, bool>> where);
        T FirstOrDefault(Expression<Func<T, bool>> where);

        void Delete(T entity);

        void Add(T entity);

        void Attach(T entity);

        void AttachAsModify(T entity,params Expression<Func<T,object>>[] properties);
    }
}
